home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
ada
/
c01oop.zip
/
ADAWKBK
/
SOL2-8.ADA
< prev
next >
Wrap
Text File
|
1992-08-25
|
706b
|
38 lines
-- Problem 2.8
-- by Rick Conn
with Text_IO;
procedure Main is
package Float_IO is new Text_IO.Float_IO (FLOAT);
type FARRAY is array (1..100) of FLOAT;
type REC is record
Count : NATURAL;
Vector : FARRAY;
end record;
type REC_PTR is access REC;
P, P2 : REC_PTR;
procedure Display (Ptr : in REC_PTR) is
begin
for I in 1 .. Ptr.Count loop
Float_IO.Put (Ptr.Vector(I), 5, 5, 0);
end loop;
Text_IO.New_Line;
end Display;
begin -- Main
P := new REC;
P2 := new REC;
P.Count := 4;
P.Vector(1..4) := (2.2, 1.1, 3.3, 4.4);
P2.Count := 2;
P2.Vector(1..2) := (10.2, 12.2);
Display (P);
Display (P2);
end Main;